<html>
<meta http-equiv="conten-type" content="text/html;charset=utf-8"/>

<img alt="" src="./images/title.png">
<hr>
<?php
session_start();
if(empty($_SESSION['name'])){
    echo "请先登录";
    header("Location:login.php");
}


header("Content-Type: text/html;charset=utf-8"); 
$name=$_GET["name"];
echo "欢迎".$name."登录成功";
//设置cookie,查看访问时间
if(!empty($_COOKIE['lastvisit'])){
    echo "&nbsp;您上次登录时间是:".$_COOKIE['lastvisit'];
    
}else{
    echo "&nbsp;您是第一次登录..";
}
setcookie("lastvisit",date("Y-m-d H:i:s"));
echo "<br/>";
echo "<a href='login.php'> 重新登录</a>";
?>
<h1>主界面</h1>
<a href="empList.php">管理用户</a><br>
<a href="addEmp.php">添加用户</a><br>
<a href="#">查询用户</a><br>
<a href="#">退出系统</a><br>
<hr>
<img alt="" src="./images/end.png">
</html>